function loadImage(src) {
    const promise = new Promise((resolve, reject) => {
        const img = document.createElement('img');
        img.onload = function()  {
            resolve(img);
        }
        img.onerror = function() {
            reject(new Error("图片加载失败"));
        }
        img.src = src;
    });


    return promise;
}

const url1 = "../../images/流程图.png";
const url2 = "../../images/流程图.png";
loadImage(url1).then(img1 => {
    console.log('img', img1);
    return loadImage(url2); // 加载第一张成功之后加载第二张图片
}, err1 => {
    console.log('err', err1);
}).then(img2 => {
    console.log('img2', img2);
}, err2 => {
    console.log('err', err2);
})